package com.pig4cloud.pig.resident.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pig.resident.feign.dto.ResidentDto;
import com.pig4cloud.pig.resident.feign.entity.Resident;
import com.pig4cloud.pig.resident.mapper.ResidentMapper;
import com.pig4cloud.pig.resident.service.ResidentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class ResidentServiceImpl extends ServiceImpl<ResidentMapper, Resident> implements ResidentService {
	@Autowired
	private ResidentMapper residentMapper;
	@Override
	public Resident checkPhone(Resident resident) {
		return residentMapper.checkPhone(resident);
	}

	@Override
	public List<Resident> getResident(Long roomId) {
		return residentMapper.getResident(roomId);
	}

	@Override
	public List<ResidentDto> getUnResident(ResidentDto residentDto) {
		return residentMapper.getUnResident(residentDto);
	}

	@Override
	public void deleteResident(Long[] ids, Long roomId) {
		residentMapper.deleteResident(ids, roomId);
	}

	@Override
	public void addRelativeResident(Long[] ids, Long roomId) {
		residentMapper.addResident(ids, roomId);
	}

	@Override
	public String[] getResidentPhone(Long roomId) {
		return residentMapper.getResidentPhone(roomId);
	}
}
